<?php /* Smarty version 2.6.18, created on 2009-10-28 01:37:52
         compiled from editInventoryDAA.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'editInventoryDAA.tpl', 45, false),)), $this); ?>
<script type="text/javascript">	
	<?php echo '
		Calendar.setup({
	        inputField     :    "cal[date_mortality]",     // id of the input field
	        ifFormat       :    "%Y-%m-%d" ,    // format of the input field
	        displayArea    :    "date_mortality",
	        daFormat       :    "%Y-%m-%d",      // format of the display area
	        button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
	        align          :    "Bl",           // alignment (defaults to "Bl")
	        singleClick    :    true,
			//onUpdate	   :    endDateChanged, //event to call after calendar is closed
	        weekNumbers    :    false,
	        zIndex		   :	2000
	    });
	'; ?>

</script>
<form name="mainForm" method="POST" id="mainForm">
<input type="hidden" name="user[inv_id]" value="<?php echo $this->_tpl_vars['invId']; ?>
">
<input type="hidden" name="user[inv_daa_id]" value="<?php echo $this->_tpl_vars['daas'][0]['inventory_daa_id']; ?>
">

<table class="popup" border="0" cellspacing=0 cellpadding=0>
	<tr><td><div class="pop">
		<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
		<div id="drag_bar"><h2 class="pop_h2">Edit DAA</h2></div>
		<div class="content">
			<table border="0" width="100%">
				<?php if ($this->_tpl_vars['invId'] == 0): ?>
				<tr>
					<td nowrap>Tank Source:</td>
					<td><select name="user[inventory_id]">
						<?php $_from = $this->_tpl_vars['sources']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['source']):
?>
							<option value="<?php echo $this->_tpl_vars['source']['inventory_id']; ?>
"><?php echo $this->_tpl_vars['source']['source']; ?>
</option>
						<?php endforeach; endif; unset($_from); ?>
						</select></td>
				</tr>
				<?php endif; ?>
				<tr>
					<td>DAA&nbsp;Quantity:</td>
					<td><input align="right" type="text" name="user[quantity_daa]" value="<?php echo $this->_tpl_vars['daas'][0]['quantity_daa']; ?>
" size="10">&nbsp;&nbsp;(ea)</td>
				</tr>
				<tr>
					<td>Mortality&nbsp;Date:</td>
					<!-- <td><input align="right" type="text" name="user[date_mortality]" value="<?php echo $this->_tpl_vars['daas'][0]['date_mortality']; ?>
" size="10"></td> -->
					<td>
						<input style="float:left" type="hidden" name="user[date_mortality]" id="cal[date_mortality]" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['daas'][0]['date_mortality'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
" size="10"> 
						<span id="date_mortality"  style="width:80px; display:block; float:left; height:15px; text-align:center;"><?php echo ((is_array($_tmp=$this->_tpl_vars['daas'][0]['date_mortality'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</span>				
						<input style="float:left" type="image" src="/app/default/www/images/calendar.jpg" align="absmiddle" id="f_trigger_c1" style="cursor: pointer; border: 0px ;" title="Date selector"/>
						<input type="hidden" name="dateYui" value="cal[date_mortality]/date_mortality/f_trigger_c1">
					</td>
				</tr>
				<tr>
					<td>Amount:</td>
					<td>
						<select name="user[currency_mark]">
							<?php $_from = $this->_tpl_vars['currencies']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['currency']):
?>
								<option value=<?php echo $this->_tpl_vars['currency']['currency_mark']; ?>
 <?php if ($this->_tpl_vars['daas'][0]['currency_mark'] == $this->_tpl_vars['currency']['currency_mark']): ?> SELECTED <?php endif; ?>><?php echo $this->_tpl_vars['currency']['currency_mark']; ?>
</option>
							<?php endforeach; endif; unset($_from); ?>
						</select>&nbsp;&nbsp;&nbsp;
						<input align="right" type="text" name="user[stock_amount]" value="<?php echo $this->_tpl_vars['daas'][0]['stock_amount']; ?>
" size="10">
					</td>
				</tr>
				<tr>
					<td style="vertical-align: top;">Reason:</td>
					<td><textarea name="user[reason]" cols="20" rows="2"><?php echo $this->_tpl_vars['daas'][0]['reason']; ?>
</textarea></td>
				</tr>
				<tr><td height="10px"></td></tr>
				<tr>
					<td colspan="2" align="center">
						<input type="button" value="Save" onclick="saveDAA('<?php echo $this->_tpl_vars['invId']; ?>
');">&nbsp;
						<input type="button" value="Close" onclick="closeDAA('<?php echo $this->_tpl_vars['invId']; ?>
');">
					</td>
				</tr>
			</table>
		</div>
		<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" />
	</div></td></tr>
</table>
</form>
<script language="javascript">
<?php echo '
	function saveDAA(invId) {
		if(invId == 0) {
			popup(\'newDAA\');
		}
		else {
			popup(\'editDAA\');
		}
		doajaxAction("/account/saveInventoryDAA/",1,\'main_content\',document.getElementById(\'mainForm\'));
	}
	function closeDAA(invId){
		if(invId == 0) {
			popup(\'newDAA\');
		}
		else {
			popup(\'editDAA\');
		}
	}


'; ?>

</script>